<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="h" uri="/syzg-html"%>
<%@ taglib prefix="security" uri="http://www.enersun.com.cn/security"%>

<!DOCTYPE html>
<html>
	<head>
		<%@ include file="/base/jsp/common/CommonListTop.jsp"%>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>[菜单名(或大模块名)-模块名]</title>
		<link href="${ctx}/base/css/common.css" rel="stylesheet" type="text/css" />
		<link href="${ctx}/base/css/${customTheme}.css" rel="stylesheet" type="text/css" />
		<script src="${ctx}/base/js/base.js" type="text/javascript"></script>
		<script src="${ctx}/base/js/common/FormFunction.js" type="text/javascript"></script>
		<script src="${ctx}/baseNew/plugins/jQuery/jQuery-2.2.0.min.js"></script>
		<link href="${ctx}/baseNew/bootstrap/css/bootstrap.min.css" rel="stylesheet">
		<script src="${ctx}/baseNew/bootstrap/js/bootstrap.js" type="text/javascript"></script>
    	<link href="${ctx}/baseNew/other/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
		<script src="${ctx}/baseNew/other/js/bootstrap-datetimepicker.js" type="text/javascript"></script>
		<script src="${ctx}/baseNew/other/js/locales/bootstrap-datetimepicker.zh-CN.js" type="text/javascript"></script>
		<link rel="stylesheet" href="${ctx}/baseNew/dist/css/AdminLTE.min.css">
  		<script src="${ctx}/baseNew/other/js/bootbox.min.js" type="text/javascript"></script>
  		<link rel="stylesheet" href="${ctx}/baseNew/validator/css/bootstrapValidator.css"/>
		<script type="text/javascript" src="${ctx}/baseNew/validator/js/bootstrapValidator.js"></script>
		<link rel="stylesheet" href="${ctx}/base/imgsel/css/style.css"/>
		<%--新增样式处理 start--%>
		  		<script src="${ctx}/zenithsun/js/ModalUtil.js" type="text/javascript"></script>
		<link rel="stylesheet" href="${ctx}/zenithsun/css/admin-imgList.css"/>
		<script src="${ctx}/zenithsun/news/specialnews/js/specialNews.js" type="text/javascript"></script>
		<!-- 公用的按钮函数 -->
		<script>
			var addUrl = "${ctx}/path/specialnews/initSpecialnews";//表单列表add 的url地址
			var delUrl = "${ctx}/path/specialnews/delSpecialnews";//表单列表del的url地址
			var viewUrl = "${ctx}/path/specialnews/viewSpecialnews";//表单列表view的url地址
			var editUrl = "${ctx}/path/specialnews/editSpecialnews";//表单列表edit的url地址
			var listUrl = "${ctx}/path/specialnews/listSpecialnews";//表单列表list 的url地址,用来作为搜索地址
			var saveAddUrl = "${ctx}/path/specialnews/addSpecialnews";//表单列表save的url地址
			var saveEditUrl = "${ctx}/path/specialnews/modSpecialnews";//表单列表save的url地址
 			var realPath = "${ctx}";
 			
 			$(function(){
                 doLoadNewsInfo();
			});
			
			function defaultEvent(eventType,width,height) {
				doLoadNewsInfo();
			}
			
			function mve(obj){
				$(obj).find(".j-popShow").show();
			}
			
			//此为图片列表鼠标经过时删除事件
			function mot(obj){
				$(obj).find(".j-popShow").hide();
			}
			
			//此为图片列表鼠标经过时点击选中事件
			function mck(obj){
				//$(obj).find("div").toggleClass('selected');
				var objBtn = $(obj).siblings().find(".j-selectId");
				var objBtnVal = objBtn.val();
				if(objBtnVal=="true"){
					objBtn.val(false);
					$(obj).parents("li").removeClass('selected');
		    		$(obj).parents(".select").removeClass('selected');
				} else if(objBtnVal=="false") {
					objBtn.val(true);
					if ($(obj).parents("li.selected").length == 0) {
					    $(obj).parents("li").addClass('selected');
					    $(obj).parents(".select").addClass('selected');
					}
				}
				//counter();
				//alert(checkItem.id+":"+checkItem.checked);
			}
			function noImage(t){
				t.src="${ctx}/zenithsun/news/mobile/images/Default-bg270x180.png"; 
				t.onerror=null;
			}
		</script>
	</head>

	<body class="rightBody">
		<form name="searchForm" method="post" action="" class="form-inline">
			<security:CSRF/>
			<table width="100%" class="title" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <th>
				    <img src="${ctx}/zenithsun/images/back.png" width="26" height="26" alt="图标 " class="icon" />
					<em class="headTips">图片新闻网管理</em> &gt; 专题新闻
				  </th>
				  <th width="200"></th>
				</tr>
				<tr>
				  <td>
				    <div class="form-group">
					  <label class="control-label sr-only" for="searchValue_'title'_">Email address</label>
					  <input type="text" name="searchValue['title']" id="searchValue_title" class="form-control input-sm" placeholder="search..."/>
					  <button type="button" class="btn btn-primary btn-sm" onclick="defaultEvent('search')">搜索</button>
				    </div>
				  </td>
				  <td align="right">
				    <div class="form-group">
				      <h:permission module="xxx_xxx" operation="add">
				        <button type="button" class="btn btn-primary btn-sm" onclick="FormFunction.showAddModal()">新增</button>
				      </h:permission>
				      <h:permission module="xxx_xxx" operation="del">
				        <button type="button" class="btn btn-primary btn-sm" onclick="defaultEvent('del')">删除</button>
				      </h:permission>
				    </div>
				  </td>
				</tr>
			</table>
			</form>
			<div class="picList js-listEdit">
				<ul class="mod-itemsLi clearfix" id="NEWS-LIST">
			  		<li id="lastNewsInfo" style="display: none;"></li>
				</ul>
			</div>
			<div id="DATA-TEMPLATE" style="display: none;">
				<li id="li-%newsinfo.id%" onmousemove="mve(this)" onmouseout="mot(this)" style="width: 285px;height: 300px;">
					<dl>
			  		  	<dt class="mod-itemsTitle">
			  		  		<h3>%newsinfo.title%</h3>
			  		  		<p class="mod-itemsTitle-decsr clearfix"></p>
			  		  	</dt>
			  		    <dd class="mod-itemsContent">
			  		      <div id="div_%newsinfo.id%">
			  		      	<img src="%newsinfo.coverPath%" id="cover_%newsinfo.id%" style="width: 265px;height: 175px;"/>
			  		      </div>
			  		      <div class="mod-itemContent-info">
			  		      		%newsinfo.createTime%
			  		      </div>
						  <div name="liSelectItem" class="picList-editGrid-wrap j-popShow" onclick="mck(this)"></div>
			  		      <div class="picList-editGrid j-popShow">
			  		        <input type="hidden" id="%newsinfo.id%" class="j-selectId" name="selectedRow" value="false" />
			  		        <a class="i-edit-btn" href="javascript:FormFunction.showEditModal('%newsinfo.id%')" title="编辑新闻"><i class="fa fa-edit"></i> </a>
			  		        <a class="i-remove-btn" href="javascript:FormFunction.delSingle('%newsinfo.id%',delUrl + '?picsubjectId=%newsinfo.id%');" title="删除新闻"><i class="fa fa-trash"></i> </a>
			  		      </div>
			  		    </dd>
			  		  </dl>
				</li>
			</div>
			<div class="pagnation" id="pagnation"></div>
		
		
		<div id="myDlg"></div>
		<%@ include file="/base/jsp/common/CommonListFoot.jsp"%>
		<script src="${ctx}/base/imgsel/js/img.js" type="text/javascript"></script>
		<script>

		//此为图片列表鼠标经过时编辑事件
		function mve(obj){
			$(obj).find(".j-popShow").show();
		}
		//此为图片列表鼠标经过时删除事件
		function mot(obj){
			$(obj).find(".j-popShow").hide();
		}
		//此为图片列表鼠标经过时点击选中事件
		function mck(obj){
			$(obj).find("div").toggleClass('selected');
			var objBtn = $(obj).find("input:checkbox");
			if(objBtn.prop('checked')){
				objBtn.prop('checked', false);
			} else {
				objBtn.prop('checked', true);
			}
		}
		function deleteSpecialNewsById(id,isSpecial){
			var ids = "";
			$("input:hidden[name='selectedNewsId']").each(function(){
				ids += $(this).val() +",";
			});
			ids = ids.substring(0,ids.length-1);
			$.post("${ctx}/path/specialnews/deleteSelectNews",{"selectedNews":ids,"delId":id,"isSpecial":isSpecial},function(data){	
				$("#newsList").html(data);
			});
		}
		function openNewsDetail(busId) {
			ModalUtil.showModal("myNewsDlg","${ctx}/path/newsinfo/viewNewsinfo2?newsId="+busId,"viewModal",function() {});
		}
		</script>
	</body>
</html>
